<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>pig书屋--个人中心</title>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" media="all">
	<link rel="stylesheet" type="text/css" href="css/qian.css" media="all">
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<%@ include file="include/top.jsp" %>

		<div class="content" style="margin:0px 10px;">
			<div class="part1 clearfix" style="border-bottom:1px double #AEAEAE;padding:0px 0px 10px 0px;">
				<ul class="breadcrumb" style="margin-bottom:0px;">
				  <li><a href="/home.action">首页</a> <span class="divider">/</span></li>
				  <li class="active">用户中心</li>
				</ul>
				<%@include file="include/userCenter-left.jsp" %>
				
	            <div class="right pull-left" style="margin-left:50px;width:600px;">
	            	<!-- 内容 -->
	            	<div>
	            		<h4 class="parts" style="border-bottom:solid 1px #000;"><i class="icon-cog"></i>用户信息修改</h4>
	            		<c:choose>
	            			<c:when test="${param.code=='10002'}">
	            				<div class="alert alert-success">
								  <button type="button" class="close" data-dismiss="alert">&times;</button>
								  <strong>密码修改成功</strong>
								</div>	
	            			</c:when>
	            			<c:when test="${param.code=='10003'}">
	            				<div class="alert alert-error">
								  <button type="button" class="close" data-dismiss="alert">&times;</button>
								  <strong>原密码输入错误</strong> 
								</div>
	            			</c:when>
	            		</c:choose>
						<form class="form-horizontal fm" method="post" action="/modifyPswd.action">
						  <div class="control-group">
						    <label class="control-label" for="inputEmail">原密码</label>
						    <div class="controls">
						      <input type="password" id="oldPswd" placeholder="原密码" name="user.pswd">
						    </div>
						  </div>
						  <div class="control-group">
						    <label class="control-label" for="inputPassword">新密码</label>
						    <div class="controls">
						      <input type="password" id="newPswd" placeholder="新密码" name="newPswd">
						    </div>
						  </div>
						  <div class="control-group">
						    <label class="control-label" for="inputPassword">确认新密码</label>
						    <div class="controls">
						      <input type="password" id="renewPswd" placeholder="再次输入新密码" name="renewPswd">
						    </div>
						  </div>
						  <div class="control-group">
						    <div class="controls">
						      <button type="button" class="btn btn-warning">修改</button>
						    </div>
						  </div>
						</form>	
	            	</div>
				</div>
			</div>
		</div>
		
		<%@ include file="include/foot.jsp" %>
	</div>
	<script src="js/validate/jquery.validate.js"></script>
	<script>
    	$(function(){
    		$(".fm").validate({
    			rules:{
    				'user.pswd':{
    					required:true,
    					rangelength:[6,18]
    				},
    				'newPswd':{
    					required:true,
    					rangelength:[6,18],
    				},
    				'renewPswd':{
    					required:true,
    					rangelength:[6,18],
    					equalTo:'#newPswd'
    				}
    			},
    			messages:{
    				'user.pswd':{
    					required:'请输入原密码',
    					rangelength:'密码长度6~18位'
    				},
    				'newPswd':{
    					required:'请输入新密码',
    					rangelength:'密码长度6~18位'
    				},
    				'renewPswd':{
    					required:'请再次输入新密码',
    					rangelength:'密码长度6~18位',
    					equalTo:'两次密码不一致'
    				}
    			}
    		});
    		$(".btn").click(function(){
    			$(".fm").submit();
    		});
    		
    	});
	</script>
</body>
</html>